//
//  loginVC.m
//  Mahjong
//
//  Created by 饶首建 on 17/6/21.
//  Copyright © 2017年 com.ikamobile.com. All rights reserved.
//

#import "loginVC.h"
#import "SetVC.h"

typedef enum : NSUInteger {
    SwitchBtnTypeQR = 0,
    SwitchBtnTypeInput
} SwitchBtnType;

@interface loginVC ()

@property (weak, nonatomic) IBOutlet UIView *inputView;
@property (weak, nonatomic) IBOutlet UITextField *nicknameTF;
@property (weak, nonatomic) IBOutlet UITextField *matchCodeTF;

@property (weak, nonatomic) IBOutlet UIView *QRView;
@property (weak, nonatomic) IBOutlet UIImageView *QRCodeImageView;

@property (weak, nonatomic) IBOutlet UIButton *switchBtn;
@property (nonatomic,assign) SwitchBtnType switchBtnType;

@end

@implementation loginVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
}

- (IBAction)loginAction:(id)sender {
    //login inputView
    SetVC *vc = [SetVC new];
    [self presentViewController:vc animated:YES completion:^{
        
    }];
}

- (IBAction)goInputAction:(id)sender {
    if (_switchBtnType == SwitchBtnTypeQR) {
        _switchBtnType = SwitchBtnTypeInput;
        [_switchBtn setTitle:@"<-微信扫码" forState:UIControlStateNormal];
        [UIView animateWithDuration:0.5 animations:^{
            _inputView.alpha = 1;
            _QRView.alpha = 0;
        }];
    }else{
        _switchBtnType = SwitchBtnTypeQR;
        [_switchBtn setTitle:@"不想留数据->" forState:UIControlStateNormal];
        [UIView animateWithDuration:0.5 animations:^{
            _inputView.alpha = 0;
            _QRView.alpha = 1;
        }];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
